package com.aaa.web.controller.userapprovecontroller;

import com.aaa.entity.AppStcardApprove;
import com.aaa.entity.BackSchool;
import com.aaa.entity.Employee;
import com.aaa.web.commons.Query;
import com.aaa.web.commons.Result;
import com.aaa.web.service.studentapproveservice.IStudentApproveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;
/**
* @description:学生后台管理Controller层
* @author: 王林林
* @create: 2018/12/28 9:29
**/
@RequestMapping("/studentapprove")
@Controller
public class StudentApproveController {

    @Autowired
    private IStudentApproveService service;
    /**
     * 点击学生用户跳转到getstudentapprove.html
     * */
    @RequestMapping("/approveStudentUserPage")
    public String approveSocialUserPage(){
        return "views/webhtml/approve/getstudentapprove";
    }
    /**
     * 点击学生用户认证跳转到toapprovestudent.html
     * */
    @RequestMapping("/studentUserPageNeedApprove")
    public String toApproveStudent(){

        return "views/webhtml/approve/toapprovestudent";
    }


    /**
     * 获取所有学生用户信息
     * */
    @RequestMapping("/getAllStudentUser")
    @ResponseBody
    public Map getAllStudentUser(Query query,AppStcardApprove stcardApprove) {
        Map m = service.getAllStudentUser(query,stcardApprove);
        return m;
    }

    /**
     * 获取所有需要认证的信息
     * */
    @RequestMapping("/getAllStudentApprove")
    @ResponseBody
    public Map getAllStudentApprove(Query query,AppStcardApprove stcardApprove) {
        Map m = service.getAllStudentApprove(query,stcardApprove);
        return m;
    }


    /**
     * 根据手机号更改通过认证的学生用户信息
     * */
    @RequestMapping("/studentapprovePass")
    @ResponseBody
    public Result studentApprovePass(String telephone) {
        return service.studentapprovePass(telephone);
    }


    /**
     * 根据手机号取消认证的学生用户信息
     * */
    @RequestMapping("/delStudentApprove")
    @ResponseBody
    public Result delStudentApprove(String telephone) {
        return service.delStudentApprove(telephone);
    }
    /**
     * select框根据数据库动态展示数据
     * */
    @RequestMapping("/getSchoolName")
    @ResponseBody
    public List<BackSchool> getSchoolName() {
        return service.getSchoolName();
    }
}
